package com.tanhua.autoconfig;

import com.tanhua.autoconfig.properties.AipfaceProperties;
import com.tanhua.autoconfig.properties.HuanXinProperties;
import com.tanhua.autoconfig.properties.OosProperties;
import com.tanhua.autoconfig.properties.SmsProperties;
import com.tanhua.autoconfig.template.AipfaceTemplate;
import com.tanhua.autoconfig.template.HuanXinTemplate;
import com.tanhua.autoconfig.template.OosTemplate;
import com.tanhua.autoconfig.template.SmsTemplate;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;

@EnableConfigurationProperties({
        SmsProperties.class,
        OosProperties.class,
        AipfaceProperties.class,
        HuanXinProperties.class
})
public class TanhuaAutoConfiguration {
    @Bean
    public SmsTemplate smsTemplate(SmsProperties properties){

        return new SmsTemplate(properties);
    }
    @Bean
    public OosTemplate ossTemplate(OosProperties properties) {
        return new OosTemplate(properties);
    }
    @Bean
    public AipfaceTemplate aipfaceTemplate(AipfaceProperties properties) {
        return new AipfaceTemplate(properties);
    }
    @Bean
    public HuanXinTemplate huanXinTemplate(HuanXinProperties properties){
        return new HuanXinTemplate(properties);
    }
}
